import * as types from '../action-types'
import api from '../../api'
const baseAction = {
    //获取用户的登录信息
    async queryUserInfoAsync() {
        let info = null;
        try {
            let { code, data } = await api.queryUserInfo();
            if (+code === 0) {
                info = data;
            }
        } catch (_) { }
        return {
            type: types.BASE_INFO,
            info
        }
    },
    //清除用户的登录信息
    clearUserInfo() {
        return {
            type: types.BASE_INFO,
            info: null
        }
    }
}
export default baseAction